<!DOCTYPE html>
<extend name="Base/base" />
<block name='head'>  
    <meta charset="utf-8">
    <link href="/Public/Index/css/workflow.css" rel="stylesheet" /> 
    <style type="text/css">
        .t4{color:#bbb}
        .trip_title h2 {
            font-size:1.3em;
            margin:1.2em;
            color:#5077aa;
        }
        .trip_next h3{
            font-size:1em;
            padding:0.8em;
        }
        .trip_next table{
            width:100%;
        }
        .trip_next table tr td{
            border:1px solid #CFDDEA;
            font-size:1.2em;
            padding:0.3em 0;
            text-align: center;
        }
        .trip_next table .value{
            width:80%;
            text-align: left;
            padding-left:10px;
        }
        .trip_next table .value .addUser,.addDept{color:#437dba}
        .trip_next table .key{
            width:17%;
            text-align: center;
            background: #F0F0F0;
        }
        .trip_next table .value .textarea{
            display:inline-block;
            border:1px solid #333;
            height:4em;
        }
        .trip_next table .value .textarea span{margin-right:0.5em}
        .trip_next table .value input,.textarea,select,textarea{
            width:55%;
            padding:0.3em;
        }

        .trip_next table .value .date{
            width:30%
        }

        .button .btn-submit{
            padding:0.3em 2em;
            font-size: 1.2em;
        }
        .button span{display:inline-block;margin-left:20%}

    </style>
</block>
<block name="content" > 
    <form name='form1'>
        <div class="bd">
            <div class="trip_title">
                <h2>编辑日志（{$data.dia_date}）</h2>
            </div>
            <div class="work_cells trip_next">
                <table>
                    <tr>
                        <td class="key">日志标题</td>
                        <td class="value">
                            <input type="text" class="dateTime"  value="{$data.subject}" id="date">日志
                            <input type="hidden" id="url" value="{:U('getDate')}">
                            <input type="hidden" name="SUBJECT" value="{$data.sub}">
                            <!--<a href="javascript:;" class="orgClear" onClick="document.form1.SUBJECT.value=''">-清空</a>-->
                        </td>
                    </tr>
                    <tr>
                        <td class="key">日志类型</td>
                        <td class="value">
                            <select name="DIA_TYPE">
                                <if condition='$data.dia_type eq 1'>
                                    <option value="1" selected>工作日志</option>
                                    <option value="2" >个人日志</option>
                                    <else />
                                    <option value="1" >工作日志</option>
                                    <option value="2" selected>个人日志</option>
                                </if>>
                            </select>
                        </td>
                    </tr>
                    <tr>
                        <td class="key">是否对所有人共享</td>
                        <td class="value">
                            <input type="checkbox" id="to_all" name="TO_ALL" value="{$data['to_all']}" style='width:16px;' {$data['to_all'] == 1 ? 'checked' : ''} >允许对所有人共享
                        </td>
                    </tr>
                    <tr>
                        <td class="key">日志内容</td>
                        <td class="value">
                            <textarea name="CONTENT" style="width:80%;height:10em;">{$data.content}</textarea>
                        </td>
                    </tr>
                    <tr>     
                        <td class="TableData" colspan="3" style="text-align:left;padding-left:0px">

                        </td>
                    </tr> 
                    <tr>
                        <td class="TableHeader" colspan="2"><div onClick="share();" title="点击展开/收缩选项" style="cursor:pointer;width:125px;"><img class="arrow" src="/Public/Index/img/right.png" align="absMiddle"> 指定共享范围</div></td>
                    </tr>       
                    <tr id="share" style="display:none">
                        <td nowrap class="TableData">共享范围：</td>
                        <td class="TableData value">
                            <p class="textarea" style="border:1px solid #929292"><span></span></p>
                            <a class="pointer addUser addUser_1" data-id="1">+添加 </a>
                            <a class="pointer delData">-清空</a>
                            <a href="#" class="orgAdd" onClick="document.getElementById('TO_NAME').value = document.getElementById('Share_Name').value;document.getElementById('TO_ID').value = document.getElementById('Share_ID').value;"> </a>

                        </td>
                    </tr>
                </table>
            </div>
            <div class="button">
                <span>
                    <input type="hidden" name="id" value="{$data.dia_id}">
                    <a class="pointer btn-submit ajax-post" data-verify="all" data-url="{:U('addDiary')}" data-form="">提交</a>
                    <!--<a class="pointer btn-submit ajax-post" data-verify="all" data-url="{:U('editDiary',array('DIA_TYPE'=>1))}" data-form="">保存</a>-->
                </span>
            </div>
        </div>
    </form>
    <div class="button">
        <a class="am-btn" onclick="history.go(-1)">返 回</a>
    </div>

</block>
<block name="script">
    <script type="text/javascript" src="/Public/Index/js/diary.js"></script>
    <script type="text/javascript">
            $(dateTime());
            $(initAddDiary());

            function share() {
                var obj = document.getElementById("share");
                if (obj.style.display == 'none') {
                    obj.style.display = '';
                    $('.arrow').attr('src', '/public/Index/img/down2.png');
                } else {
                    obj.style.display = 'none';
                    $('.arrow').attr('src', '/Public/Index/img/right.png');
                }
            }

    </script>
</block>
